package com.woniuxy01;

/**
 * @author 作者
 * @create 2025-07-28 14:09
 */
public class Test04 {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer("aaa");
        sb.append("");

    }

    private static void test03() {
        //String和StringBuilder不是兼容类型
        String str="aaa";
        //String转StringBuilder
        StringBuilder sb=new StringBuilder(str);
        //StringBuilder转String
        String str2=sb.toString();
    }

    public static String stringReverse(String str){
        return new StringBuilder(str).reverse().toString();
    }


    private static void test02() {
        StringBuilder sb=new StringBuilder("abcdefg");
        sb.reverse();
        System.out.println(sb);
    }

    private static void test01() {
        //        String str="aaa";
//        System.out.println(str);
//        str=str.concat("bbb");
//        System.out.println(str);

        StringBuilder sb=new StringBuilder("aaa");
        System.out.println(sb);
        sb.append("bbb");
        System.out.println(sb);
        sb.insert(2, "ccc");
        System.out.println(sb);
        sb.delete(2,5);
        System.out.println(sb);
    }
}
